package com.burgeon.backend.SHOPBACKEND.service;

import com.burgeon.backend.SHOPBACKEND.entity.*;
import org.json.JSONException;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;

public interface MaterialService {
    //新增分组
    Integer insertMaterialGroup(MultipartFile file, String groupName, String account);

    //查看所有分组
    MaterialGroupVo findGroupByAccount(String account);

    //删除分组
    void deGroupById(String ids, String account) throws JSONException;

    //修改分组
    Integer upGroupName(String id, String groupName,MultipartFile file,String account);

    //搜索分组
    MaterialGroupVo findGroupByName(String account,String groupName);

    /**===============================素材========================================**/
    //新增素材(图片)
    Integer insertMaterial(MultipartFile[] files, String materialName, String groupId,
                           String imgDescribe,  String account,String price);
    //根据id修改
    Integer upMaterial(String materialName,String groupId,String imgDescribe,String id,String price);

    //根据id查看素材信息
    MaterialVo findMaterialById(String id);
    Material getMaterialById(String id);

    //查看所有素材
    MaterialEO getMaterialAll(String account,int page);

    //搜索素材
    MaterialEO findWebMaterialByName(String account,String materialName,int page,String groupId);

    //删除素材
    void deMaterialById(String ids,String account) throws JSONException;

    //删除素材图片
    Integer deMateriaImglById(String id,String account);

    /**++++++++++++++++++++++++++++++素材图片+++++++++++++++++++++++++++++++++++++++++++*/
    Integer insertMaterialImgs(String mid, MultipartFile file,String account);


    /**================================素材连接=====================================*/
    Integer addMaterialLink(String miid, String gid);

    String findMaLinkById(String id);

    //根据素材图片id修改链接
    Integer upMaLinkByMid(String mid, String gid);

    /**===================================商品==========================================*/
    MaterialGoods findGoodsById(String id);

}
